//
//  viewconfig.h
//  jipin
//
//  Created by lcb on 5/12/15.
//  Copyright (c) 2015 liuchengbin. All rights reserved.
//

#import "OHAttributedLabel.h"
#import "RootViewController.h"
#import "ZGlobal.h"
#import "ZCommontHeader.h"
//开发版 运营版

#define isDevelopment 1


#define ICON_WIDTH (PHOTO_FRAME_WIDTH*12)
#define BAOLIAO_CELL_HEIGHT (PHOTO_TIME_PADDING *2 + ICON_WIDTH)

#define REFRESH_NOTIFICATION   @"REFRESH_NOTIFICATION"
#define DEVICE_HEIGHT       [UIScreen mainScreen].bounds.size.height
#define DEVICE_WIDTH       [UIScreen mainScreen].bounds.size.width

#define IMAGESIZE  (([UIScreen mainScreen].bounds.size.width*2.1)/5)
#define BDIMAGESIZE  (([UIScreen mainScreen].bounds.size.width*1)/5)

#define SHADOW_OFFSET_OF_TEXT  CGSizeMake(0,0.55) //CGSizeMake(0.55,0.55)
#define SHADOW_OFFSET_OF_PAILIDE  CGSizeMake(0,0.15)

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)


#define FONT_NAME_BOLD   ((SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) ? (@"PingFangSC-Regular") : (@"STHeitiSC-Light"))
#define FONT_NAME  ((SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) ? (@"PingFangSC-Light") : (@"STHeitiSC-Light"))

#define FONT(Size)  [UIFont fontWithName:FONT_NAME size:Size]
#define FONT_BOLD(Size) [UIFont fontWithName:FONT_NAME_BOLD size:Size]


//方正黑体简体字体定义STHeitiSC

#define LSpacing 2
#define PHOTO_FRAME_WIDTH_16   floor([UIScreen mainScreen].bounds.size.width/16)
#define PHOTO_FRAME_WIDTH   10
#define PHOTO_TIME_PADDING  floor([UIScreen mainScreen].bounds.size.width/64)
#define USER_ICON_PADDING  floor([UIScreen mainScreen].bounds.size.width/84)
#define CAT_BUTTON_HEIGHT   32
#define USER_ICON_WIDTH_IN_LIST floor([UIScreen mainScreen].bounds.size.width/6.5)
#define BOOK_FRAME 18
#define TIMELINE_LEFT   15
#define TIME_LEFT   15
#define TIME_HEIGHT 13
#define NICKNAME_COLOR [UIColor darkGrayColor]
#define LABEL_HEIGHT 12
#define MORE_BUTTON_HEIGHT  30
#define TITLE_FONT  [UIFont systemFontOfSize:16]
#define ALPHA_BACKVIEW_PAILIDE  0.92f
#define PAILIDE_WHITE_FRAME_COLOR [UIColor colorWithRed:0.965 green:0.965 blue:0.965 alpha:1]
#define TOP_ACTIVE_BUTTON_HEIGHT     ceil((float)38/667 * [UIScreen mainScreen].bounds.size.height)
#define TOP_NOACTIVE_BUTTON_HEIGHT     floor((float)35/667 * [UIScreen mainScreen].bounds.size.height)
#define TAG_ALPHA   0.7f
#define TAG_ALPHA_COMMENT   0.65f

#define TEXT_TAG_COLOR [UIColor colorWithRed:0.149 green:0.149 blue:0.149 alpha:1]

#define COLOR_TAG_COMMENT   [UIColor colorWithRed:0.149 green:0.204 blue:0.357 alpha:1]
#define NAVIGATION_BAR_COLOR [UIColor colorWithRed:0.890 green:0.875 blue:0.851 alpha:1]
#define NAVBAR_HIGHT       65
#define SUNRISE [UIColor colorWithRed:0.788 green:0.643 blue:0.369 alpha:1]
#define SUNSET [UIColor colorWithRed:0.255 green:0.490 blue:0.965 alpha:1]
#define SHOT_BUTTON_WIDTH 64
#define BUTTON_WIDTH_IN_HOME_PAGE   50
#define SC_DEVICE_BOUNDS    [[UIScreen mainScreen] bounds]
#define SC_DEVICE_SIZE      [[UIScreen mainScreen] bounds].size
#define EDIT_FONT  [UIFont fontWithName:@"Helvetica" size:12]
#define BUTTON_COLOR_NOACTIVE [UIColor colorWithRed:0.682 green:0.349 blue:0.369 alpha:0.75]
#define BUTTON_COLOR_ACTIVE [UIColor colorWithRed:0.682 green:0.349 blue:0.369 alpha:0.9]
#define BUTTON_COLOR_FILTER [UIColor colorWithRed:0.243 green:0.239 blue:0.388 alpha:1]
#define EDIT_HEIGHT 38
#define TITLE_BAR_HEIGHT   44

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define PAD_LINE 20
#define PAD_LEFT 14
#define PAD_RIGHT 13.5

//

#define PRICE_LABEL_COLOR   [UIColor blackColor]
#define HILIGHT_COLOR [UIColor blueColor]
#define RED_COLOR   UIColorFromRGB(0xCE0202)//UIColorFromRGB(0xCE0202)
#define SEARCH_BAR_COLOR  [UIColor colorWithRed:0.987 green:0.987 blue:0.987 alpha:1]

#define DARK_BACKGROUND_COLOR SEARCH_BAR_COLOR //[UIColor colorWithRed:0.11 green:0.11 blue:0.11 alpha:1]

#define BLUE_COLOR  [UIColor colorWithRed:0.078 green:0.357 blue:0.757 alpha:1]
#define TITLE_COLOR  [UIColor colorWithRed:0.216 green:0.208 blue:0.231 alpha:1]//[UIColor blackColor]
#define CONTEXT_COLOR [UIColor darkGrayColor]

#define BOTTOM_TOOLBAR_HEIGHT   40


#define SVInfiniteScrollingViewHeight  80

//
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)

#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)

#if __IPHONE_6_0 // iOS6 and later

#   define kTextAlignmentCenter_SC    NSTextAlignmentCenter
#   define kTextAlignmentLeft_SC      NSTextAlignmentLeft
#   define kTextAlignmentRight_SC     NSTextAlignmentRight

#   define kTextLineBreakByWordWrapping_SC      NSLineBreakByWordWrapping
#   define kTextLineBreakByCharWrapping_SC      NSLineBreakByCharWrapping
#   define kTextLineBreakByClipping_SC          NSLineBreakByClipping
#   define kTextLineBreakByTruncatingHead_SC    NSLineBreakByTruncatingHead
#   define kTextLineBreakByTruncatingTail_SC    NSLineBreakByTruncatingTail
#   define kTextLineBreakByTruncatingMiddle_SC  NSLineBreakByTruncatingMiddle

#else // older versions

#   define kTextAlignmentCenter_SC    UITextAlignmentCenter
#   define kTextAlignmentLeft_SC      UITextAlignmentLeft
#   define kTextAlignmentRight_SC     UITextAlignmentRight

#   define kTextLineBreakByWordWrapping_SC       UILineBreakModeWordWrap
#   define kTextLineBreakByCharWrapping_SC       UILineBreakModeCharacterWrap
#   define kTextLineBreakByClipping_SC           UILineBreakModeClip
#   define kTextLineBreakByTruncatingHead_SC     UILineBreakModeHeadTruncation
#   define kTextLineBreakByTruncatingTail_SC     UILineBreakModeTailTruncation
#   define kTextLineBreakByTruncatingMiddle_SC   UILineBreakModeMiddleTruncation

#endif
